<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section 
 *
 * @package WordPress
 * @subpackage Bito
 * @since Bito 2.0
 */
?><!DOCTYPE html>

<html <?php language_attributes(); ?>>
<head>

<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<title><?php bloginfo('name'); wp_title(); ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen, projection" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); 
wp_head(); ?>
</head>

<body <?php body_class(); ?>>
	<div id="container"<?php echo bito_col_class(); ?>>
		<div id="header">
			<form id="searchform" action="<?php echo home_url(); ?>/" method="get">
				<div><input value="<?php echo esc_html(); ?>" name="s" id="s" />
				<input type="submit" value="Search" id="searchsubmit" /></div>
			</form>
			<div id="headerimg">
				<h1><a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a></h1>
				<div class="description"><?php bloginfo('description'); ?></div>
			</div>
		</div>
	<div id="navigation">
		<ul>
		<li<?php if (is_front_page()) echo ' class="selected"'; ?>>
			<a href="<?php echo home_url(); ?>" title="Home"><?php _e('Home', 'bito'); ?></a>
		</li>
<?php
		/*
		* loop all pages, check selected status,
		*/
		$pages = get_pages('sort_column=menu_order');
		foreach ($pages as $page) {
			switch ($page->post_name) {
			case 'archives':
				(is_page($page->ID) || is_archive() || is_search() || is_single())?$selected = ' class="selected"':$selected='';
				break;
			default:
				(is_page($page->ID))?$selected = ' class="selected"':$selected='';
			}
			echo '<li', $selected, '><a href="', get_page_link($page->ID), '">', $page->post_title, '</a></li>', "\n"; 

		}
?>

		</ul>
	</div>

	<div id="navigationline">&nbsp;</div>

